package c.j.a.d.b.j;

import android.database.sqlite.SQLiteException;
import c.j.a.d.b.n.a;
import com.ss.android.socialbase.downloader.g.c;
import java.util.Objects;

/* compiled from: AbsDownloadEngine */
public class e implements Runnable {
    public final /* synthetic */ int a;
    public final /* synthetic */ boolean b;
    public final /* synthetic */ c c;

    public e(c cVar, int i, boolean z) {
        this.c = cVar;
        this.a = i;
        this.b = z;
    }

    public void run() {
        this.c.m(this.a);
        c cVar = this.c;
        int i = this.a;
        boolean z = this.b;
        Objects.requireNonNull(cVar);
        try {
            c b = cVar.i.b(i);
            if (b != null) {
                a.n(b, z);
                b.Q();
            }
            cVar.i.d(i);
            cVar.i.a(b);
        } catch (SQLiteException e) {
            e.printStackTrace();
        } catch (Throwable th) {
            th.printStackTrace();
            return;
        }
        if (cVar.c.get(i) != null) {
            cVar.c.remove(i);
        }
        if (cVar.b.get(i) != null) {
            cVar.b.remove(i);
        }
        synchronized (cVar.f) {
            cVar.f.remove(Integer.valueOf(i));
        }
        c.j.a.d.b.l.a.j(i);
    }
}
